package 动态规划;

/**
 * @author 帅小伙
 * @date 2021/12/23
 * @description
 */
public class Demo03跳楼梯 {

    public int jumpFloor(int target) {
        if(target <= 2){
            return target;
        }
        int a = 1,b = 2;
        for (int i = 2; i < target; i++) {
            int t = b;
            b +=a;
            a = t;
        }
        return b;
    }
}
